package com.moli.iov.handle.alarm.enums;

/**
 * <p>
 * 报警状态 1、终端上报 2、平台判断离线报警
 * </p>
 *
 * @author: zql
 * @Date: 2019/3/4 10:05
 */
public enum OnOffTypeEnum {

    /**
     * 在终端上报
     */
    REPORTING(1, "终端上报"),

    /**
     * 平台判断离线报警
     */
    PLATFORM(2, "平台判断离线报警");

    private int flag;

    private String msg;

    OnOffTypeEnum(int flag, String msg){
        this.flag = flag;
        this.msg = msg;
    }

    public static String getMsg(int flag){
        for(OnOffTypeEnum e : OnOffTypeEnum.values()){
            if(e.flag == flag){
                return e.msg;
            }
        }
        return "";
    }

    public int getFlag() {
        return flag;
    }


    public String getMsg() {
        return msg;
    }
}
